package com.jl.jlapp.popu;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.jl.jlapp.R;

public class InvoiceAndCouponPromptPopu extends PopupWindow {
    private TextView tvKnow;
    private TextView tvOnlinePay;
    private TextView tvTitle;
    private View view;

    public InvoiceAndCouponPromptPopu(Context paramContext, int paramInt) {
        super(paramContext);
        this.view = ((LayoutInflater) paramContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.invoice_and_coupon_prompt_popu, null);
        this.tvKnow = ((TextView) this.view.findViewById(R.id.tv_know));
        this.tvOnlinePay = ((TextView) this.view.findViewById(R.id.tv_online_pay));
        this.tvTitle = ((TextView) this.view.findViewById(R.id.tv_title));
        if (paramInt == 0) {
            this.tvTitle.setText("发票须知");
        }
        for (; ; ) {
            this.tvKnow.setOnClickListener(new OnClickListener() {
                public void onClick(View paramAnonymousView) {
                    InvoiceAndCouponPromptPopu.this.dismiss();
                }
            });
            setContentView(this.view);
            setWidth(-1);
            setHeight(-1);
            setFocusable(true);
            setAnimationStyle(R.style.AnimBottom);
            setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(paramContext,R.color.white)));
            this.view.setOnTouchListener(new OnTouchListener() {
                public boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent) {
                    paramAnonymousView = (CardView) InvoiceAndCouponPromptPopu.this.view.findViewById(R.id.layout);
                    int i = paramAnonymousView.getTop();
                    int j = paramAnonymousView.getLeft();
                    int k = paramAnonymousView.getHeight();
                    int m = paramAnonymousView.getWidth();
                    int n = (int) paramAnonymousMotionEvent.getY();
                    int i1 = (int) paramAnonymousMotionEvent.getX();
                    if ((paramAnonymousMotionEvent.getAction() == 1) && ((n < i) || (n > i + k) || (i1 < j) || (i1 > j + m))) {
                        InvoiceAndCouponPromptPopu.this.dismiss();
                    }
                    return true;
                }
            });
            return;
//            this.tvTitle.setText("使用说明");
        }
    }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/popu/InvoiceAndCouponPromptPopu.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */